package com.vic.framework.helper;

import java.util.Properties;

import com.vic.framework.constant.ConfigConstant;
import com.vic.framework.utils.PropsUtils;

/**
 * 属性文件助手
 * @author VIC
 *
 */
public final class ConfigHelper {

	private static final Properties  CONFIG_PROPS = PropsUtils.loadProps(ConfigConstant.CONFIG_FILE);
	
	public static String getJdbcDriver(){
		return PropsUtils.getString(CONFIG_PROPS, ConfigConstant.JDBC_DRIVER);
	}
	
	public static String getJdbcURL(){
		return PropsUtils.getString(CONFIG_PROPS, ConfigConstant.JDBC_URL);
	}
	
	public static String getJdbcUsername(){
		return PropsUtils.getString(CONFIG_PROPS, ConfigConstant.JDBC_USERNAME);
	}
	
	public static String getJdbcPassword(){
		return PropsUtils.getString(CONFIG_PROPS, ConfigConstant.JDBC_PASSWORD);
	}
	
	public static String getAppBasePath(){
		return PropsUtils.getString(CONFIG_PROPS, ConfigConstant.APP_BASE_PACKAGE);
	}
	
	public static String getJspPath(){
		return PropsUtils.getString(CONFIG_PROPS, ConfigConstant.APP_JSP_PACKAGE);
	}
	
	public static String getStaticPath(){
		return PropsUtils.getString(CONFIG_PROPS, ConfigConstant.APP_STATIC_PACKAGE);
	}

	public static int getAppUploadLimit() {
		return PropsUtils.getInt(CONFIG_PROPS, ConfigConstant.APP_UPLOAD_LIMIT, 10) ;
	}
	
}
